#!/bin/bash
sudo systemctl stop  aslamM.service;pkill -f matching.launch;pkill -f mapping.launch;rosnode kill /mapping_node;echo y |rosnode cleanup;sudo systemctl restart aslamS.service
aslams_state=$(rosnode list |grep /mapping_node|wc -l)
echo y |rosnode cleanup
sleep 5
echo y |rosnode cleanup
if [ $aslams_state == 0 ];then
 sudo systemctl restart aslamS.service
fi
